package dq.study.jvm.classloader;

/**
 * 通过子类调用父类的静态变量时不会触发子类的初始化
 *
 * @author dongqun
 * @date 2020/9/8 16:44
 */
public class PassiveInvokeDemo1 {


    public static void main(String[] args) {
        System.out.println(SuperClass.value);
    }
}


class SuperClass {

    static int value = 123;

    static {
        System.out.println("super class initialized");
    }
}

class SubClass extends SuperClass {

    static {
        System.out.println("sub class initialized");
    }
}